
#ifndef HTTP_H
#define HTTP_H 

#include<Arduino.h>
#include "config.h"
typedef void (*HttpCallBack)(String);

class Http
{
private:
    int requestTimes=0;

    String data;
    String url;
    HttpCallBack callback;
public:
 
   void requestTimesPlus(){
    requestTimes++;
   }

   int  getRequestTimes(){
        return this->requestTimes;
    }

    void setHttpCallBack( HttpCallBack callback){
        this->callback = callback;
    }

     HttpCallBack   getHttpCallBack(){
        return this->callback;
     }


    void setData(String data){
        this->data = data;
    }

    void setUrl(String url){
        this->url = url;
    }

    String getData(){
        return this->data;
    }

    String getUrl(){
        return this->url;
    }

    Http(/* args */);
    ~Http();
};


//typedef void (*HttpCallBack)(const char *);

int setUpWiFi();
String getWiFiLocalIP();

void requestGet();

int requestPost(String url, String msg, HttpCallBack callback);
void requestPost1(String url, String msg, HttpCallBack callback,HttpCallBack error);
void testHttps();
void setClock1();
void requestGets();
void testHttps();

 

void  addCachePost(Http http);
void  sendCachePost();
void requestPost(Http http );




#endif